import type { ButtonProps } from 'element-plus'
import type { CSSProperties, VNodeChild } from 'vue'
import { createTypes, type VueTypesInterface, type VueTypeValidableDef } from 'vue-types'
import type { JSX } from 'vue/jsx-runtime'

export type VueNode = VNodeChild | JSX.Element
type PropTypes = VueTypesInterface & {
  readonly style: VueTypeValidableDef<CSSProperties>
  readonly VNodeChild: VueTypeValidableDef<VueNode>
  // readonly trueBool: VueTypeValidableDef<boolean>;
}
export const propTypes = createTypes({
  func: undefined,
  bool: undefined,
  string: undefined,
  number: undefined,
  object: undefined,
  integer: undefined,
}) as PropTypes

export type ButtonOptions = Partial<ButtonProps> & {
  title?: string
  type?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'default'
  label?: string
  onClick?: () => void
  ifShow?: boolean
  icon?: string
  /**
   * 按钮提示类型 upload上传 messageBox确定提示
   */
  btnType?: 'upload' | 'messageBox'
  /**
   * 标题
   */
  messageTitle?: string
  /**
   *  提示内容
   */
  messageContent?: string
  /**
   * 确定事件
   */
  confirm?: () => void

  /**取消事件 */
  cancel?: () => void
  /**
   * 确定按钮文字
   */
  confirmText?: string

  /**取消按钮文字 */
  cancelText?: string
  /**
   * class
   */
  class?: string
  /**
   * tooltip提示框
   */
  tooltip?: string | ButtonOptions[]
  /**上传 参数 */
  componentProps?: object
  messageType?: '' | 'success' | 'warning' | 'info' | 'error'
}
